{% extends 'base_admin.html'%}
{% load static %}

{% block module %}
用户管理
{% endblock %}
{% block active1 %}
    active
{% endblock %}
{% block content %}
    
    <a style="margin-bottom: 20px;" class="btn btn-primary" href="/add">
    <span class="glyphicon glyphicon-circle-arrow-down" aria-hidden="true"></span>
    添加用户</a>
    <div class="panel panel-default">
        <div class="panel-heading">
            <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
            用户列表</div>
        <table class="table table-bordered">
                <thead>
                    <tr>
                        <td class="items">ID</td>
                        <td class="items">姓名</td>
                        <td class="items">密码</td>
                        <td class="items">年龄</td>
                        <td class="items">操作</td>
                    </tr>
                </thead>
                {% for item in data %}
                    <tbody>
                        <tr>
                            <td class="items">{{item.id}}</td>
                            <td class="items">{{item.name}}</td>
                            <td class="items">{{item.password}}</td>
                            <td class="items">{{item.age}}</td>
                            <td class="items">
                                <a class="btn btn-primary btn-xs" href="/{{item.id}}/update">编辑</a>
                                <a class="btn btn-danger btn-xs" href="/delete?nid={{ item.id }}">删除</a>
                            </td>
                        </tr>
                    </tbody>
                {% endfor %}
            </table>

    </div>
   
{% endblock %}
{%block script%}
<script>
    $('#add').click(function(){
        window.location.href = '/add'
    })
</script>
{% endblock%}